Telegram Group & Telegram Channel
137. Program to check whether the number is palindrome or not using recursion.

#include<stdio.h>

int checkPalindrome(int);

int main() {

int n, sum;

printf("Enter a number : ");
scanf("%d",&n);

sum = checkPalindrome(n);

if(n == sum)
printf("%d is a palindrome", n);
else
printf("%d is not a palindrome", n);

return 0;
}

int checkPalindrome(int n) {

static int sum=0, r;
if(n != 0)
{
r = n % 10;
sum = sum * 10 + r;
checkPalindrome(n/10);
}
return sum;
}
@C_Codings



tg-me.com/C_Codings/199
Create:
Last Update:

137. Program to check whether the number is palindrome or not using recursion.

#include<stdio.h>

int checkPalindrome(int);

int main() {

int n, sum;

printf("Enter a number : ");
scanf("%d",&n);

sum = checkPalindrome(n);

if(n == sum)
printf("%d is a palindrome", n);
else
printf("%d is not a palindrome", n);

return 0;
}

int checkPalindrome(int n) {

static int sum=0, r;
if(n != 0)
{
r = n % 10;
sum = sum * 10 + r;
checkPalindrome(n/10);
}
return sum;
}
@C_Codings

BY C Language πŸ‘¨β€πŸ’»


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/C_Codings/199

View MORE
Open in Telegram


C Language ‍ Telegram | DID YOU KNOW?

Date: |

Find Channels On Telegram?

Telegram is an aspiring new messaging app that’s taking the world by storm. The app is free, fast, and claims to be one of the safest messengers around. It allows people to connect easily, without any boundaries.You can use channels on Telegram, which are similar to Facebook pages. If you’re wondering how to find channels on Telegram, you’re in the right place. Keep reading and you’ll find out how. Also, you’ll learn more about channels, creating channels yourself, and the difference between private and public Telegram channels.

A Telegram spokesman declined to comment on the bond issue or the amount of the debt the company has due. The spokesman said Telegram’s equipment and bandwidth costs are growing because it has consistently posted more than 40% year-to-year growth in users.

C Language ‍ from jp


Telegram C Language πŸ‘¨β€πŸ’»
FROM USA